/*
 *  SPAGL Copyright (C) 2008 Sam Pottinger
 *  This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 
 *  General Public License as published by the Free Software Foundation; either version 2.1 of the License, or 
 *  (at your option) any later version. This library is distributed in the hope that it will be useful, but 
 *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 *  See the GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License along with this library; if not, 
 *  write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
 */

package spagcore;

/**
 * An interface to standardize the use of combo boxes or "drop down menus"
 * @author Sam Pottinger
 */
public interface SpaglCoreCombo extends SpaglCoreWidget, SpaglFontCapable, SpaglCoreEventGenerator {
	
	/**
	 * Adds an element to the combo box
	 * 
	 * @param newElement the new object to be added
	 */
	public void addElement(Object newElement);
	
	/**
	 * Sets the combo box to a given array of objects
	 * 
	 * @param newElementList an array of objects that will be associated with this widget
	 */
	public void setElementList(Object[] newElementList);
	
	/**
	 * Removes an element at a given position
	 * 
	 * @param i the index of the element to remove
	 */
	public void removeElement(int i);
	
	/**
	 * Removes all elements from this combo box
	 */
	public void removeAllElements();
	
	/**
	 * Get the index of the of the selected object
	 * 
	 * @return the index of the choice selected by the user
	 */
	public int getSelectedIndex();
	
	/**
	 * Set the choosen object to the selected index
	 * 
	 * @param i the index to be selected
	 */
	public void setSelectedIndex(int i);

}
